
	** ATITUDE TOWARDS VIOLENCE **

	// Norms on Violence (7m and 2w2w, 13m, p3_e5w)

		sum nvstrangerrob_e nvowetakesthg_e nvknowncriminal_e nvstorekeeperpunish_e nvkillstorekeeperpunish_e nvbeatwoman_e nvdestroyproperty_e nvstealfriendsgirl_e nvcorruptleaderbeaten_e nvbeatwife_e nvgirlrape_e
		d nvstrangerrob_e nvowetakesthg_e nvknowncriminal_e nvstorekeeperpunish_e nvkillstorekeeperpunish_e nvbeatwoman_e nvdestroyproperty_e nvstealfriendsgirl_e nvcorruptleaderbeaten_e nvbeatwife_e nvgirlrape_e
		tab1 nvstrangerrob_e nvowetakesthg_e nvknowncriminal_e nvstorekeeperpunish_e nvkillstorekeeperpunish_e nvbeatwoman_e nvdestroyproperty_e nvstealfriendsgirl_e nvcorruptleaderbeaten_e nvbeatwife_e nvgirlrape_e

		* Rescale to be additive more tolerant towards violence
			foreach var in nvstorekeeperpunish nvkillstorekeeperpunish {
				gen `var'_resc_e = (`var'_e*-1)+1
				local lab: var lab `var'_e
				la var `var'_resc_e "Rescaled: `lab'"
			}

		sum nvstrangerrob_e nvowetakesthg_e nvknowncriminal_e nvstorekeeperpunish_resc_e nvkillstorekeeperpunish_resc_e nvbeatwoman_e nvdestroyproperty_e nvstealfriendsgirl_e nvcorruptleaderbeaten_e nvbeatwife_e nvgirlrape_e
		d nvstrangerrob_e nvowetakesthg_e nvknowncriminal_e nvstorekeeperpunish_e nvkillstorekeeperpunish_e nvbeatwoman_e nvdestroyproperty_e nvstealfriendsgirl_e nvcorruptleaderbeaten_e nvbeatwife_e nvgirlrape_e

		egen attviolence_e = rowtotal (nvstrangerrob_e nvowetakesthg_e nvknowncriminal_e nvstorekeeperpunish_resc_e nvkillstorekeeperpunish_resc_e nvbeatwoman_e nvdestroyproperty_e nvstealfriendsgirl_e nvcorruptleaderbeaten_e nvbeatwife_e nvgirlrape_e), missing
			la var attviolence_e "Attitude towards the use of violence to solve pbs (0-11) Additive Index of 11 questions"

		* Create version of violence index only using high/low emphasis components
		egen attviolence_g1_e = rowtotal (nvstealfriendsgirl_e nvgirlrape_e), missing
			la var attviolence_g1_e "Attitude towards violence, emphasis greater than 1"
		egen attviolence_le1_e = rowtotal (nvstrangerrob_e nvowetakesthg_e nvknowncriminal_e nvstorekeeperpunish_resc_e nvkillstorekeeperpunish_resc_e nvbeatwoman_e nvdestroyproperty_e nvcorruptleaderbeaten_e nvbeatwife_e), missing
			la var attviolence_le1_e "Attitude towards violence, emphasis less than or equal to 1"

		gen attviolence_g15_e = .
			la var attviolence_g15_e "Attitude towards violence, emphasis greater than 1.5"
		egen attviolence_le15_e = rowtotal (nvstealfriendsgirl_e nvgirlrape_e nvstrangerrob_e nvowetakesthg_e nvknowncriminal_e nvstorekeeperpunish_resc_e nvkillstorekeeperpunish_resc_e nvbeatwoman_e nvdestroyproperty_e nvcorruptleaderbeaten_e nvbeatwife_e), missing
			la var attviolence_le15_e "Attitude towards violence, emphasis less than or equal to 1.5"

		gen attviolence_g2_e = .
			la var attviolence_g2_e "Attitude towards violence, emphasis greater than 2"
		egen attviolence_le2_e = rowtotal (nvstealfriendsgirl_e nvgirlrape_e nvstrangerrob_e nvowetakesthg_e nvknowncriminal_e nvstorekeeperpunish_resc_e nvkillstorekeeperpunish_resc_e nvbeatwoman_e nvdestroyproperty_e nvcorruptleaderbeaten_e nvbeatwife_e), missing
			la var attviolence_le2_e "Attitude towards violence, emphasis less than or equal to 2"

		* shorten name *
		gen nvkillstore_resc_e =  nvkillstorekeeperpunish_resc_e

	// Norms on Criminality  (7m and 2w2w, 13m, p3_e5w)

		sum attstchinamanbeat_e attstblackmoney_e  attstnightops_e attsttaxiwallet_e attstmoneydroptake_e attstfamilylec_e attstmoneybagtake_e attstmoneyhangtake_e attstroomvaluablestake_e attselfdrugsell_e attstknownindiv_e attstifreturn_e
		tab1 attstchinamanbeat_e attstblackmoney_e  attstnightops_e attsttaxiwallet_e attstmoneydroptake_e attstfamilylec_e attstmoneybagtake_e attstmoneyhangtake_e attstroomvaluablestake_e attselfdrugsell_e attstknownindiv_e attstifreturn_e
		d attstchinamanbeat_e attstblackmoney_e  attstnightops_e attsttaxiwallet_e attstmoneydroptake_e attstfamilylec_e attstmoneybagtake_e attstmoneyhangtake_e attstroomvaluablestake_e attselfdrugsell_e attstknownindiv_e attstifreturn_e

		* Rescal to be additive more tolerant towards violence
			foreach x in attstnightops {
				gen `x'_resc_e = (`x'_e*-1)+1
				local lab: var lab `x'_e
				la var `x'_resc_e "Rescaled: `lab'"
			}

		sum attstchinamanbeat_e attstblackmoney_e  attstnightops_resc_e attsttaxiwallet_e attstmoneydroptake_e attstfamilylec_e attstmoneybagtake_e attstmoneyhangtake_e attstroomvaluablestake_e attselfdrugsell_e attstknownindiv_e attstifreturn_e

		egen attcriminality_e = rowtotal (attstchinamanbeat_e attstblackmoney_e  attstnightops_resc_e attsttaxiwallet_e attstmoneydroptake_e attstfamilylec_e attstmoneybagtake_e attstmoneyhangtake_e attstroomvaluablestake_e attselfdrugsell_e attstknownindiv_e attstifreturn_e), missing
			la var attcriminality_e "Attitude towards criminality to make money (0-12) Additive index of 12 survey questions"

		* Create version of criminality index only using high/low emphasis components
		egen attcriminality_g1_e = rowtotal (attstblackmoney_e  attstnightops_resc_e attstmoneydroptake_e attstroomvaluablestake_e attselfdrugsell_e attstknownindiv_e), missing
			la var attcriminality_g1_e "Attitude toward criminality, emphasis greater than 1"
		egen attcriminality_le1_e = rowtotal (attstchinamanbeat_e attstfamilylec_e attsttaxiwallet_e attstmoneybagtake_e attstmoneyhangtake_e attstifreturn_e), missing
			la var attcriminality_le1_e "Attitude toward criminality, emphasis less than or equal to 1"

		egen attcriminality_g15_e = rowtotal (attstnightops_resc_e attstmoneydroptake_e attstroomvaluablestake_e attselfdrugsell_e attstknownindiv_e), missing
			la var attcriminality_g15_e "Attitude toward criminality, emphasis greater than 1.5"
		egen attcriminality_le15_e = rowtotal (attstblackmoney_e attstchinamanbeat_e attstfamilylec_e attsttaxiwallet_e attstmoneybagtake_e attstmoneyhangtake_e attstifreturn_e), missing
			la var attcriminality_le15_e "Attitude toward criminality, emphasis less than or equal to 1.5"

		egen attcriminality_g2_e = rowtotal (attselfdrugsell_e), missing
			la var attcriminality_g2_e "Attitude toward criminality, emphasis greater than 2"
		egen attcriminality_le2_e = rowtotal (attstblackmoney_e attstchinamanbeat_e attstnightops_resc_e attstmoneydroptake_e attstroomvaluablestake_e attstfamilylec_e attsttaxiwallet_e attstmoneybagtake_e attstmoneyhangtake_e attstifreturn_e attstknownindiv_e), missing
			la var attcriminality_le2_e "Attitude toward criminality, emphasis less than or equal to 2"


// POLITICAL VIOLENCE (p2_e2w2w, p1_e12m p3_b)

		* 2 sets of questions:
			* p1_e12m and p3_b p2_e2w2w p3_e5w
				sum pvhypdemstpaid_e pvhyppalpaid_e pvhyppalpaid200ld_e pvhypdemstpaidwcheat_e pvhyppalpaidwcheat_e pvhyppalpaid200ldwcheat_e if p1_e12m ==1
				sum pvhypdemstpaid_e pvhyppalpaid_e pvhyppalpaid200ld_e pvhypdemstpaidwcheat_e pvhyppalpaidwcheat_e pvhyppalpaid200ldwcheat_e if p2_e2w2w ==1
				sum pvhypdemstpaid_e pvhyppalpaid_e pvhyppalpaid200ld_e pvhypdemstpaidwcheat_e pvhyppalpaidwcheat_e pvhyppalpaid200ldwcheat_e if p3_e5w==1
				sum pvhypdemstpaid_b pvhyppalpaid_b pvhyppalpaid200ld_b pvhypdemstpaidwcheat_b pvhyppalpaidwcheat_b pvhyppalpaid200ldwcheat_b if p3==1

			* p2_e2w2w only
			 	sum pvtalkdemst_e pvtalkpal_e pvtalkdemstwcheat_e pvtalkpalwcheat_e  if p2_e2w2w==1

				* Rescale variables only  for p2_e2w2w
					gen pvtalkdemstdum_e = (pvtalkdemst_e!=4) if p2_e2w2w==1 & pvtalkdemst_e!=.
					gen pvtalkpaldum_e = (pvtalkpal_e!=4) if p2_e2w2w==1 & pvtalkpal_e!=.
					gen pvtalkdemstwcheatdum_e = (pvtalkdemstwcheat_e!=4) if p2_e2w2w==1 & pvtalkdemstwcheat_e!=.
					gen pvtalkpalwcheatdum_e = (pvtalkpalwcheat_e!=4) if p2_e2w2w==1 & pvtalkpalwcheat_e!=.

*The coming politicalviolhas a problem: we changed the amounts of money for the last rounds. So the question is being done out of 4 for round 8.
*This is a quick fix:

		replace pvhyppalpaid200ld_e = pvhyppalpaid300ld_e if round == 8
		replace pvhyppalpaid200ldwcheat_e = pvhyppalpaid300ldwcheat_e if round == 8


		* Construction Index
			egen politicalviol_e = rowtotal (pvhypdemstpaid_e  pvhyppalpaid_e pvhyppalpaid200ld_e pvhypdemstpaidwcheat_e  pvhyppalpaidwcheat_e pvhyppalpaid200ldwcheat_e), missing
				la var politicalviol_e "Political Violence Index (0-6) add of 6 questions"


*replace politicalviol_e = rowtotal (pvhypdemstpaid_e  pvhyppalpaid_e pvhyppalpaid300ld_e pvhypdemstpaidwcheat_e  pvhyppalpaidwcheat_e pvhyppalpaid300ldwcheat_e) if round == 8, m


			gen politicalvioldum_e = (politicalviol_e!=0)
				la var politicalvioldum_e "Political Violence Dummy"

			egen politicalviol_b = rowtotal (pvhypdemstpaid_b pvhyppalpaid_b pvhyppalpaid200ld_b pvhypdemstpaidwcheat_b pvhyppalpaidwcheat_b pvhyppalpaid200ldwcheat_b) if p3==1, missing
				la var politicalviol_b "Political Violence Index"

			gen politicalvioldum_b = (politicalviol_b!=0) if p3==1
				la var politicalvioldum_b "Political Violence Dummy"

		* Counstruct index with only low/high emphasis outcomes
			gen politicalviol_g1_e = .
				la var politicalviol_g1_e "Political Violence Index (0-6) add of 10 questions, emphasis greater than 1"
			egen politicalviol_le1_e = rowtotal (pvhypdemstpaid_e  pvhyppalpaid_e pvhyppalpaid200ld_e pvhypdemstpaidwcheat_e  pvhyppalpaidwcheat_e pvhyppalpaid200ldwcheat_e), missing
				la var politicalviol_le1_e "Political Violence Index (0-6) add of 6 questions, emphasis less than or equal to 1"

			gen politicalviol_g15_e = .
				la var politicalviol_g15_e "Political Violence Index (0-6) add of 6 questions, emphasis greater than 1.5"
			egen politicalviol_le15_e = rowtotal (pvhypdemstpaid_e  pvhyppalpaid_e pvhyppalpaid200ld_e pvhypdemstpaidwcheat_e  pvhyppalpaidwcheat_e pvhyppalpaid200ldwcheat_e), missing
				la var politicalviol_le15_e "Political Violence Index (0-6) add of 6 questions, emphasis less than or equal to 1.5"

			gen politicalviol_g2_e = .
				la var politicalviol_g2_e "Political Violence Index (0-6) add of 6 questions, emphasis greater than 2"
			egen politicalviol_le2_e = rowtotal (pvhypdemstpaid_e  pvhyppalpaid_e pvhyppalpaid200ld_e pvhypdemstpaidwcheat_e  pvhyppalpaidwcheat_e pvhyppalpaid200ldwcheat_e), missing
				la var politicalviol_le2_e "Political Violence Index (0-6) add of 6 questions, emphasis less than or equal to 2"








foreach talkvar in cvtalkdemstpc cvtalkdemstvi    cvtalkvjrogue cvtalkvjviolator    cvtalkvjgroup {

	gen my_`talkvar'_rsc_e = 4 - `talkvar'_e
	gen my_`talkvar'_bin_e = (`talkvar'_e < 3)
	replace my_`talkvar'_bin_e = . if `talkvar'_e == .


}



egen cv_hyp_e = rowtotal(    cvhypdemstvi_e    cvhypvjrogue_e cvhypvjviolator_e    cvhypvjgroup_e ), m
	la var cv_hyp_e "HYP Community Violence Index (0-4): Hypothethically joining violent situations."


egen cv_join_e = rowtotal(       cvjoindemstvi6m_e     cvjoinvjrogue6m_e  cvjoinvjviolator6m_e     cvjoinvjgroup6m_e  ), m
	la var cv_join_e "JOIN Community Violence Index (0-4): Joining violent situations."


egen cv_see_e = rowtotal(          cvseedemstvi6m_e      cvseevjrogue6m_e    cvseevjviolator6m_e       cvseevjgroup6m_e   ), m
	la var cv_see_e "SEE Community Violence Index (0-4): Seeing violent situations."


egen cv_talk_e = rowtotal(            my_cvtalkdemstvi_bin_e    my_cvtalkvjrogue_bin_e my_cvtalkvjviolator_bin_e    my_cvtalkvjgroup_bin_e  ), m
	la var cv_talk_e "TALK Community Violence Index (0-4): Friends talk about violent situations."
